#include <iostream>
#include <vector>
#include <set>
#include <numeric>
#include <algorithm>

using namespace std;

static bool prime(uint64_t num) {
    if (num < 2) return false;
    if (num == 2) return true;
    if (num % 2 == 0) return false;

    for (uint64_t i = 3; i * i <= num; i += 2) {
        if (num % i == 0) return false;
    }
    return true;
}

static void fuck1() {
    constexpr int target = 51 - 2;
    set<uint64_t> s {1};
    vector<uint64_t> a {1, 1};
    for (int i = 0; i < target; ++i) {
        vector<uint64_t> b {1};
        for (int j = 1; j < a.size(); ++j) {
            b.push_back(a[j - 1] + a[j]);
            s.insert(b.back());
        }
        b.push_back(1);
        a = b;
    }

    for (auto it = s.begin(); it != s.end(); ) {
        if (*it % 4 == 0)
            it = s.erase(it);
        else
            ++it;
    }

    uint64_t lim = *max_element(s.begin(), s.end());
    for (uint64_t i = 3; i * i <= lim; i += 2) {
        if (!prime(i)) 
            continue;

        for (auto it = s.begin(); it != s.end(); ) {
            if (*it % (i * i) == 0)
                it = s.erase(it);
            else
                ++it;
        }
    }
        
    cout << accumulate(s.begin(), s.end(), 0ULL) << endl;
}

int main() {
    fuck1();
}